<div id="dialog_${dialog.viewCode}">
    <template>
        <el-dialog title="${dialog.title}" :visible.sync="${dialog.viewCode}DialogVisible">
            <#if dialog.contentType == "form">
                <#include "include/pure_form_item.ftl">
            <#elseif dialog.contentType == "datagrid">
                <#--TODO datagrid-->
            </#if>

            <#if dialog.buttons??>
                <div slot="footer" class="dialog-footer">
                    <#list dialog.buttons as button>
                        <el-button <#if button.type??>type="${button.type}"</#if> <#if button.onclick??>@click="v_${button.onclick}"</#if> >${button.name}</el-button>
                    </#list>
                </div>
            </#if>
        </el-dialog>
    </template>
</div>

<script type="text/javascript">
    var ${dialog.viewCode}Data = {
        data() {
            return {
                ${dialog.viewCode}DialogVisible: false,
                <#if dialog.contentType == "form">
                    <#include "include/pure_form_item_model.ftl">
                <#elseif dialog.contentType == "datagrid">
                    <#--TODO datagrid-->
                <#else>
                    v_ignore_${dialog.viewCode}_prop:""
                </#if>
            };
        },
        methods: {
            <#if dialog.contentType == "form">
                <#include "include/pure_form_methods.ftl">
            <#elseif dialog.contentType == "datagrid">
                <#--TODO datagrid-->
            <#else>
                v_ignore_${dialog.viewCode}_meth: function(){}
            </#if>

            <#if dialog.buttons??>
                ,
                <#list dialog.buttons as button>
                    <#if button.onclick??>
                        v_${button.onclick}: function() {
                            <#if button.sysFunction??>
                                <#if button.sysFunction == "submit">
                                    this.submitForm_${viewCode}();
                                    if (this.${viewCode}.submitStatus == "error" || this.${viewCode}.submitStatus == "validateError") {
                                        return;
                                    }
                                <#elseif button.sysFunction == "reset">
                                    this.resetForm_${viewCode}();
                                <#elseif button.sysFunction == "cancel">
                                    ${dialog.viewCode}DialogVisible = false;
                                </#if>
                            </#if>

                            ${button.onclick}(this);
                        }
                    <#else>
                        v_${dialog.viewCode}_${button?index}: function() {}
                    </#if>
                    <#sep >,
                </#list>
            </#if>
        }
    };

    var ${dialog.viewCode}Form = Vue.extend(${dialog.viewCode}Data);
    new ${dialog.viewCode}Form().$mount('#dialog_${dialog.viewCode}');
</script>